﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BoYuan.Framework.LogLib;

namespace BoYuan.FineUIMvcWeb.Code
{
    public class ErrorFilter : HandleErrorAttribute
    {
        /// <summary>
        /// 全局异常处理
        /// </summary>
        /// <param name="filterContext"></param>
        public override void OnException(ExceptionContext filterContext)
        {
            string errorMsg;
            var exception = filterContext.Exception;
            errorMsg = exception.Message;

            Logger.Default.Error(errorMsg);

            filterContext.ExceptionHandled = true;
        }
    }
}